<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
/**
 * 审批详情表
 */
class CreateWorkflowDescTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('workflow_desc', function (Blueprint $table) {
            $table->increments('id');
	        $table->integer('workflow_id')->comment('审核流模板id');
	        $table->integer('from_uid')->comment('发起人uid')->nullable();
	        $table->integer('from_sid')->comment('发起员工id')->nullable();
	        $table->integer('step')->comment('当前审批步数')->default(1);
	        $table->integer('lovel_role')->comment('下级审批人角色');
	        $table->integer('lovel_uid')->comment('下级审批人uid');
	        $table->integer('status')->comment('审核状态:1审核进行中，2同意，3拒绝');
	        $table->integer('type')->comment('审批类型：1排班审批，2中止审批，3临时调动审批')->nullable();
	        $table->integer('settlement_id')->comment('排班id')->nullable();
	        $table->integer('stop_id')->comment('终止结算id')->nullable();
	        $table->integer('leave_id')->comment('中止审批id')->nullable();
	        $table->integer('move_task_id')->comment('临时调动审批id')->nullable();

	        $table->string('code')->nullable();


	        $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('workflow_desc');
    }
}
